package task15;

import java.util.Scanner;

/**
 * @author Administrator
 */
public class Task15_3 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入两个数：");
        int num1=scanner.nextInt();
        int num2=scanner.nextInt();
        int result= max(num1,num2);
        System.out.println("最大值是："+result);
        result=getEvenSum(num1,num2);
        System.out.println("偶数和是："+result);
        printStar(num1,num2);
    }

    private static void printStar(int num1, int num2) {
        for(int i=1;i<=num1;i++){
            for(int j=1;j<=num2;j++){
                System.out.print("*");
            }
            System.out.println();
        }
    }

    private static int max(int num1, int num2) {
        int max=num1>num2?num1:num2;
        return max;
    }
    private static int getEvenSum(int num1, int num2) {
        int sum=0;
        for(int i=num1;i<=num2;i++){
            if(i%2==0){
                sum=sum+1;
            }
        }
        return sum;
    }
}
